<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">后付费设置</div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">堂食 </label>
                                <div class="am-u-sm-9 am-u-end">
                                	<label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][0]" value="0" data-am-ucheck
                                            <?= $values['postpaid'][0] == 0 ? 'checked' : '' ?> >
                                        关闭
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][0]" value="1" data-am-ucheck
                                            <?= $values['postpaid'][0] == 1 ? 'checked' : '' ?> >
                                        开启
                                    </label>
                                    <div class="help-block">
                                        <small>餐后付款</small>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">外卖 </label>
                                <div class="am-u-sm-9 am-u-end">
                                	<label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][1]" value="0" data-am-ucheck
                                            <?= $values['postpaid'][1] == 0 ? 'checked' : '' ?> >
                                        关闭
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][1]" value="1" data-am-ucheck
                                            <?= $values['postpaid'][1] == 1 ? 'checked' : '' ?> >
                                        开启
                                    </label>
                                    <div class="help-block">
                                        <small>代收款</small>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">自取 </label>
                                <div class="am-u-sm-9 am-u-end">
                                	<label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][2]" value="0" data-am-ucheck
                                            <?= $values['postpaid'][2] == 0 ? 'checked' : '' ?> >
                                        关闭
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="payment[postpaid][2]" value="1" data-am-ucheck
                                            <?= $values['postpaid'][2] == 1 ? 'checked' : '' ?> >
                                        开启
                                    </label>
                                    <div class="help-block">
                                        <small>到店付款</small>
                                    </div>
                                </div>
                            </div>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">微信支付商户号设置</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">特约商户 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input v-model="is_sub" type="radio" name="payment[wx][is_sub]" value="0" data-am-ucheck
                                            <?= $values['wx']['is_sub']  == 0 ? 'checked' : '' ?> >
                                        否
                                    </label>
                                    <label class="am-radio-inline">
                                        <input v-model="is_sub" type="radio" name="payment[wx][is_sub]" value="1" data-am-ucheck
                                            <?= $values['wx']['is_sub'] == 1 ? 'checked' : '' ?> >
                                        是
                                    </label>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">
                                    商户号 <span class="tpl-form-line-small-title">MCHID</span>
                                </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="payment[wx][mchid]"
									value="<?= $values['wx']['mchid'] ?>">
									<small>我还没有，<a href="<?= url('wxapp.register/pay') ?>">去申请</a></small>
                                </div>
                            </div>
                            <div v-if="is_sub == 0">
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">
                                    支付密钥 <span class="tpl-form-line-small-title">APIKEY</span>
                                </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="payment[wx][apikey]"
                                    value="<?= $values['wx']['apikey'] ?>">
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">
                                    apiclient_cert.pem
                                </label>
                                <div class="am-u-sm-9 am-u-end">
                                     <textarea rows="3" name="payment[wx][cert_pem]"><?= $values['wx']['cert_pem'] ?></textarea>
                                    <small>退款功能必填：使用文本编辑器打开apiclient_cert.pem文件，将文件的全部内容复制进来</small>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">
                                    apiclient_key.pem
                                </label>
                                <div class="am-u-sm-9 am-u-end">
                                     <textarea rows="3" name="payment[wx][key_pem]"><?= $values['wx']['key_pem'] ?></textarea>
                                    <small>退款功能必填：使用文本编辑器打开apiclient_key.pem文件，将文件的全部内容复制进来</small>
                                </div>
                            </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-2 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="assets/plugins/vue/vue.min.js"></script>
<script>
    $(function () {
        new Vue({
          el: '#my-form',
          data: {
            is_sub:<?= $values['wx']['is_sub']?>
          }
        });
        $('#my-form').formPost();

    });
</script>
